import { WOW } from 'wowjs'
export default {
    props: {
        obj: {
            type: Object
        }
    },
    watch: {
        'obj.animateImg': {
            handler(newValue, oldValue) {
                this.$nextTick(() => { // 在dom渲染完后,再执行动画
                    const wow = new WOW({
                        live: false
                    })
                    wow.init()
                })
            },
            deep: true
        },
        'obj.animateText': {
            handler(newValue, oldValue) {
                this.$nextTick(() => { // 在dom渲染完后,再执行动画
                    const wow = new WOW({
                        live: false
                    })
                    wow.init()
                })
            },
            deep: true
        },
        'obj.animateTitle': {
            handler(newValue, oldValue) {
                this.$nextTick(() => { // 在dom渲染完后,再执行动画
                    const wow = new WOW({
                        live: false
                    })
                    wow.init()
                })
            },
            deep: true
        }
    },
    mounted() {
        this.$nextTick(() => { // 在dom渲染完后,再执行动画
            this.hackRest = true
            const wow = new WOW({
                live: false
            })
            wow.init()
        })
    },
    methods: {
        goClick(url) {
            if (url) {
                window.open(url)
            }
        }
    }
}
